Conventionally, a numerical control (hereinafter, referred to as NC) device reads a machining program outputted from a CAD (Computer Aided Design) system or a CAM (Computer Aided Manufacturing) system, and controls an operation of a machine tool that machines a workpiece that is a machining object. Machining patterns for which the NC device controls a machine tool includes a pattern created by a contour machining process for machining a contour plane. In the contour machining, when a minute line segment program for a contour machining process is outputted from the CAD or CAM system, a minute movement command toward an axis other than a contour plane is sometimes erroneously outputted. The conventional NC device cannot determine whether the minute movement command is an erroneously outputted noise command, and thus outputs a noise command according to erroneous program to a drive unit of the machine tool.
The drive unit outputs a torque command to a motor for each axis according to a movement command, and moves a workpiece or the like with the motors to a designated position. One of functions of the drive unit is a lost motion compensation (hereinafter, referred to as LMC) function. The LMC function is a function of compensating a response delay caused by friction, distortion, expansion and contraction, backlash, or the like, occurring when a moving direction of a machine is inverted at a time when an orthant of the axis is changed. The drive unit can improve a protrusion phenomenon at the time of orthant change and a turning point at the time of orthant change in circular cutting by virtue of use of the LMC function.
Even if a movement command is a noise command, the drive unit having received the movement command from the NC device outputs a torque command including LMC when the direction of the noise command is inverted from a positive direction to a negative direction or from a negative direction to a positive direction. For this reason, when the amount of LMC for the noise command is excessive in the drive unit, a workpiece may be damaged. To prevent the drive unit from applying LMC, the NC device needs to read a program ahead and execute control to synchronize a timing when it is determined that minute invert occurs in the program and a timing when the drive unit applies the LMC, that is, control to issue a command for instructing the drive unit not to apply the LMC.
For example, Patent Literature 1 listed below discloses a technique of compensating a movement path to eliminate an adverse influence caused by a minute line segment of a program generated due to a calculation error of a CAM or the like. Patent Literature 2 listed below discloses a technique of switching between enablement and disablement of a process of decimating blocks from an NC program using an M code or a G code in numerical control for controlling a five-axis processing machine.